﻿using Hrm.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hrm.Services
{
    public class DictionaryService :BaseService<Dictionary>, IDictionaryService
    {
        IDictionaryPermissionDbRepository _dictionaryPermissionDbRepository;
        public DictionaryService(IDictionaryPermissionDbRepository dictionaryPermissionDbRepository)
            : base(dictionaryPermissionDbRepository)
        {
            this._dictionaryPermissionDbRepository = dictionaryPermissionDbRepository;
        }

        public IEnumerable<Dictionary> GetDictionaryByType(string type)
        {
            return this._dictionaryPermissionDbRepository.GetList(p => p.Type == type).OrderBy(p=>p.Order).ToList();
        }
    }
}
